@import "./yue";

section#post {
    .post-pager {
        margin-top: 2rem;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        color: $textColor;
        .theme-dark & {
            color: $td-textColor;
        }
        border-radius: 4px;
        > div {
            padding-top: 2.5rem;
            width: calc(50% - 1rem);
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            text-align: center;
            position: relative;
            a {
                display: block;
            }
            h2 {
                margin: 0;
                line-height: 1.3;
                font-size: 1.25rem;
            }
            p {
                margin: 0;
                margin-top: 0.3rem;
                font-size: 1rem;
                color: rgba(0, 0, 0, 0.42);
                .theme-dark & {
                    color: $td-textColor-dark;
                }
                line-height: 1.4;
            }
            &::before {
                position: absolute;
                left: 50%;
                transform: translateX(-50%);
                top: 0.4rem;
                font-size: 14px;
                padding: 0.2em 0.5em;
                color: rgba(0, 0, 0, 0.2);
                border: 1px solid rgba(0, 0, 0, 0.1);
                .theme-dark & {
                    color: rgba(#fff, 0.2);
                    border-color: rgba(#fff, 0.15);
                }
                border-radius: 4px;
            }
            &.prev {
                &::before {
                    content: "上一篇";
                }
                &::after {
                    content: "";
                    width: 1px;
                    height: calc(100% - 1rem);
                    background: #ddd;
                    .theme-dark & {
                        background: rgba(255, 255, 255, 0.1);
                    }
                    position: absolute;
                    right: -1rem;
                    top: 0.5rem;
                }
            }
            &.next {
                &::before {
                    content: "下一篇";
                }
            }
        }
        @media screen and (max-width: 767.5px) {
            flex-direction: column;
            > div {
                width: 100%;
                text-align: left;
                align-items: flex-start;
                &::before {
                    left: 0;
                    transform: translateX(0);
                }
                &::after {
                    display: none;
                }
                &:first-child {
                    padding-bottom: 0.8rem;
                    margin-bottom: 0.8rem;
                    border-bottom: 1px solid #ddd;
                    .theme-dark & {
                        border-color: rgba(255, 255, 255, 0.1);
                    }
                }
            }
        }
    }
}

article {
    .headline {
        color: #999;
        font-size: 1.42em;
        font-weight: 300;
        margin: 1.5em 0;
        position: relative;
        padding: 25px 0;
        text-align: center;
        border-top: 1px solid $borderColor;
        border-bottom: 1px solid $borderColor;
        .theme-dark & {
            border-color: $td-borderColor;
        }
        &::before,
        &::after {
            content: "";
            @include bg;
            background-image: url();
            display: block;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            top: -12.5px;
            width: 25px;
            height: 25px;
        }
        &::after {
            top: unset;
            bottom: -12.5px;
            transform: translateX(-50%) rotate(180deg);
        }
    }
    .post-banner {
        transition: $animationTime $animationTimingFunc all;
        img {
            width: 100%;
            margin: 0!important;
        }
        margin-bottom: 25px;
        width: calc(100% + 40px);
        max-width: calc(100% + 40px)!important;
        margin-left: -20px;
        @media screen and (min-width: 1200px) {
            width: 1024px;
            margin-left: -102px;
        }
        @media screen and (min-width: 1200px) and (max-width: 1599.5px) {
            .sidebar-show & {
                width: calc(100% + 40px)!important;
                margin-left: -20px!important;
            }   
        }
    }
    img.biaoqing {
        display: inline-block;
        height: 2em;
        vertical-align: bottom;
        margin: 0;
        box-shadow: none;
    }
    a[data-fancybox] {
        display: block;
        width: 100%;
        img {
            display: block;
            margin: 0;
        }
    }
    div.articleBody {
        &.full {        
            margin-bottom: 2rem;
        }
        .serif & {
            font-family: $void-font-serif;
        }
    }
    div.articleBody figure {
        figcaption {
            padding: 0 20px;
        }
    }

    /* base style for figure */
    figure {
        position: relative;
        clear: both;
        outline: 0;
        margin: 15px auto;
        padding: 0;
        width: 100%;
        overflow: hidden;
        max-width: 100%!important;
        a[data-fancybox="gallery"] {
            display: block;
            position: relative;
            max-width: 100%;
            height: 0;
            padding: 0;
            overflow: hidden;

            transition: 0.3s $animationTimingFunc background-color;
            &.lazyload-container {
                background-color: rgb(240, 240, 240);
                .theme-dark & {
                    background-color: rgba(240, 240, 240, 0.05);
                }
                &.loaded {
                    background-color: transparent;
                }
            }

            img {
                position: absolute;
                width: 100%;
                height: 100%;
                left: 0;
                top: 0;
                object-fit: cover;
                box-sizing: border-box;
            }
        }
        figcaption {
            position: relative;
            width: 100%;
            text-align: center;
            left: 0;
            margin-top: 10px;
            font-weight: 400;
            font-size: 14px;
            color: $fadeColor;
            .theme-dark & {
                color: $td-textColor-dark;
            }
            a {
                text-decoration: none;
                color: $fadeColor;
                .theme-dark & {
                    color: $td-textColor-dark;
                }
            }
        }
    }

    .photos {
        figure {
            margin: 2.5px;
            flex: 1;
            @media screen and (max-width: 767px) {
                figcaption {
                    display: none;
                }
            }
            &:first-child {
                margin-left: 0;
            }
            &:last-child {
                margin-right: 0;
            }
            figcaption {
                position: absolute;
                left: 0;
                right: 0;
                bottom: 0;
                width: auto;
                margin: 0;
                padding: 60px 0 10px!important;
                color: #fff;
                background-image: linear-gradient(
                    180deg,
                    hsla(0, 0%, 100%, 0) 0,
                    rgba(0, 0, 0, 0.03) 26%,
                    rgba(0, 0, 0, 0.4) 71%,
                    rgba(0, 0, 0, 0.5)
                );
                opacity: 0.6;
                transition: opacity 0.3s $animationTimingFunc;
            }
            &:hover figcaption {
                opacity: 1;
            }
        }
        display: flex;
        flex-wrap: wrap;
        transition: $animationTime $animationTimingFunc all;
        @media screen and (max-width: 860.5px) {
            width: calc(100% + 40px);
            margin-left: -20px;
        }
        &.large {
            @media screen and (min-width: 1200px) {
                width: 1024px;
                margin-left: -102px;
            }
            @media screen and (min-width: 1366px) {
                width: 1200px;
                margin-left: -190px;
            }
        }
        @media screen and (min-width: 1200px) and (max-width: 1599.5px) {
            .sidebar-show & {
                width: 100%!important;
                margin-left: 0!important;
            }
        }
    }
    sup {
        margin: 0 0.3rem;
        display: inline-block;
        text-indent: 0;
        width: 14px;
        text-align: center;
        font: 700 8px/14px -apple-systrem, BlinkMacSystremFont, Helvetica Neue, PingFang SC, Hiragino Sans GB,
            Microsoft YaHei, sans-serif;
        border-bottom: 0;
        background-color: rgba(0, 0, 0, 0.18);
        border-radius: 14px;
        vertical-align: text-top;
        -webkit-transition: all 0.1s $animationTimingFunc;
        -o-transition: all 0.1s $animationTimingFunc;
        transition: all 0.1s $animationTimingFunc;
        &:hover {
            background: $darkColor;
        }
        a {
            color: #eee !important;
            border: none;
        }
    }
    
    ruby {
        background-color: rgba(146, 185, 204, 0.2);
        margin: 4px;
        padding: 0 2px;
        border-radius: 4px;
    }
    ruby > rt {
        font-style: italic;
        color: #6a8998;
        margin-right: 2px;
        font-size: 60%;
    }
    details {
        summary {
            cursor: pointer;
            outline: none;
            & + * {
                margin-top: 0!important;
            }
        }  
        > br {
            display: none;
        }
    }
    span.copy-link {
        display: none;
    }
    span.copy-link.loaded {
        margin-left: 0.5em;
        cursor: pointer;
        font-size: 0.9em;
        opacity: 0.2;
        @media screen and (min-width:1023.5px) {
            &:hover {
                opacity: 1;
            }
        }
    }
    h1, h2, h3, h4, h5, h6 {
        &:hover span.copy-link.loaded{
            display: inline;
        }
    }
}

.yue {
    del {
        text-decoration: none!important;
        transition: $animationTime $animationTimingFunc color, 
                    $animationTime $animationTimingFunc background;
        * {
            transition: $animationTime-slow $animationTimingFunc opacity;
        }
    }
    del:not(:hover) {
        color: transparent!important;
        background: black!important;
        * {
            opacity: 0!important;
        }
        &, & * {
            border: none !important;
        }
    }
}
.board-list {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    padding-top: 1em;
    margin-left: -15px;
    width: calc(100% + 15px);
    .board-item {
        position: relative;
        background: white;
        box-shadow: 0 0 20px 2px rgba(0, 0, 0, 0.1);
        transition: all 0.3s;
        overflow: hidden;
        display: flex;
        flex-flow: column nowrap;
        justify-content: flex-start;
        border: none !important;
        &.hover {
            transform: scale(0.95);
        }
        @media screen and (min-width: 768px) {
            &:hover {
                transform: scale(0.97);
                border: none !important;
            }
        }
        .board-thumb {
            position: relative;
            width: 100%;
            padding-top: 100%;
            img {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                object-fit: cover;
                margin: 0;
                padding: 0;
                transition: $animationTime-very-slow ease-in-out opacity;
            }
        }
        .board-title,
        .board-title a {
            padding: 8px 0 !important;
            font-size: 1.2em !important;
            overflow: hidden !important;
            white-space: nowrap !important;
            text-align: center !important;
            color: $textColor !important;
            font-weight: 700 !important;
            border: none;
            &:hover {
                border: none;
            }
        }
        margin-left: 15px;
        margin-bottom: 15px;
        @media screen and (max-width: 767px) {
            /* 3个 */
            width: calc(33.33333333% - 15px)
        }
        @media screen and (min-width: 768px) {
            /* 4个 */
            width: calc(25% - 15px)
        }
        @media screen and (max-width: 450px) {
            /* 2个 */
            width: calc(50% - 15px)
        }
    }
}

.headline, .post-meta-index {
    font-family: $void-font-sans!important;
}

.toc-mask {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: $bgColor;
    z-index: 3;
    opacity: 0.85;
    transition: $animationTime $animationTimingFunc;
    .theme-dark & {
        background: $td-bgColor;
    }
    display: none;
    @media screen and (max-width: 1199.5px) {
        .sidebar-show & {
            display: block;
        }   
    }
}
.TOC {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 3;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    width: 280px;
    right: -280px;
    @include sidebar;
    padding: 1rem;
    padding-right: 0;
    padding-top: 60px;
    &::-webkit-scrollbar {
        display: none;
    }
    &::before {
        content: "Contents";
        position: absolute;
        left: 0;
        top: 0;
        line-height: 60px;
        height: 60px;
        width: 100%;
        font-size: 20px;
        font-weight: 600;
        text-transform: uppercase;
        text-align: center;
        color: $td-textColor;
        box-sizing: border-box;
    }
    bottom: 0;
    transition: $animationTime $animationTimingFunc right;
    .theme-dark &::-webkit-scrollbar{
        background: none;
    }
    * {
        color: $td-textColor;
    }
    .toc-list {
        position: relative;
        .toc-list {
            position: unset;
        }
    }
    li {
        a {
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            display: block;
            width: 100%;
            &:hover, &.is-active-link {
                color: #54bc4b;
            }
        }
    }
    .is-active-link::before {
        content: "";
        background-color: rgba(0, 0, 0, 0.3);
        display: block;
        height: 2.1rem;
        left: -1rem;
        position: absolute;
        width: calc(100% + 1rem);
        border-left: 2px solid #54BC4B;
        z-index: -1;
        box-sizing: border-box;
    }
    @media screen and (min-width: 1199.5px){
        .toc-link:hover::before {
            content: "";
            background-color: rgba(0, 0, 0, 0.3);
            display: block;
            height: 2.1rem;
            left: -1rem;
            position: absolute;
            width: calc(100% + 1rem);
            border-left: 2px solid #54BC4B;
            z-index: -1;
            box-sizing: border-box;
        }
    }
    .sidebar-show & {
        right: 0;
    }
}

@media screen and (max-width: 1199.5px) {
    div.contents-wrap {
        transition: $animationTime $animationTimingFunc opacity;
    }
}

@media screen and (min-width: 1199.5px) {
    div.contents-wrap,
    main>.lazy-wrap,
    #comments,
    body>footer {
        transition: $animationTime $animationTimingFunc transform;
    }
    body>header{
        transition: $animationTime $animationTimingFunc all;
    }
    .sidebar-show{
        div.contents-wrap,
        main>.lazy-wrap,
        #comments,
        >footer{
            transform: translateX(-135px);
            .banner-title {
                padding-left: 150px;
                padding-right: 150px;
            }
        }
        >header{
            padding-right: 270px;
        }
    } 
}

#toggle-toc {
    display: none;
}

.sidebar-show #ctrler-panel {
    #toggle-toc {
        a {
            transform: rotate(180deg);
            animation-fill-mode: forwards;
        }
    }
}

.social-button {
    padding: 1.125rem 0;
    border-top: 1px solid $borderColor;
    border-bottom: 1px solid $borderColor;
    .theme-dark & {
        border-color: $td-borderColor;
    }
    a.social-button-icon {
        border: none !important;
        font-size: 1.5rem;
        display: inline-flex;
        vertical-align: bottom;
        i {
            color: $fadeColor;
            .theme-dark &{
                color: $td-textColor-dark;
            }
            &:hover {
                color: #ff5268
            }
        }
    }
}
#social {
    .post-like {
        margin: 0 auto;
        display: block;
        font-weight: bold !important;
        color: $fadeColor !important;
        .theme-dark & {
            color: $td-textColor !important;
        }
        &:hover,
        &.done {
            color: white !important;
            border: 2px solid $darkColor !important;
        }
    }
}
.bigfoot-footnote__tooltip {
    .theme-dark & {
        background: $td-borderColor;
    }
}
.bigfoot-footnote {
    .theme-dark & {
        background: $td-borderColor;
    }
}
.bigfoot-footnote__content {
    padding: 0.5em 0.8em;
    .theme-dark & {
        background: $td-bgColor-dark;
        color: $td-textColor;
    }
}